<?php

// 展示订单的状态
$orderNo = '2022090110551234';
$title = '玩具小汽车';
$image = 'http://lesson01.test/images/1.jpg';
$price = 39.8;
$status = 5; // 1未付款  2待发货 3 待评价  4 已完成 5 已取消

$statusTitle = '未知';
//if($status == 1) {
//    $statusTitle = '未付款';
//} elseif($status == 2) {
//    $statusTitle = '待发货';
//} elseif($status == 3) {
//    $statusTitle = '待评价';
//} elseif($status == 4) {
//    $statusTitle = '已完成';
//} elseif($status == 5) {
//    $statusTitle = '已取消';
//}
// switch
switch ($status) {
    case 1: $statusTitle = '未付款'; break;
    case 2: $statusTitle = '待发货'; break;
    case 3: $statusTitle = '待评价'; break;
    case 4: $statusTitle = '已完成'; break;
    case 5: $statusTitle = '已取消'; break;
}

?>

<html>
<head>
    <meta charset="utf-8">
    <title>订单详情</title>
</head>
<body>
    <div>订单号：<?php echo $orderNo;?></div>
    <div>商品名称： <?php echo $title;?></div>
    <div>
        <img src="<?php echo $image;?>" alt="" width="200" height="140">
    </div>
    <div>状态: <?php echo $statusTitle;?></div>
</body>
</html>
